package com.linyx.simpleboot.service;

import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SqlSessionService {
	
	@Autowired
	SqlSessionTemplate sqlSessionTemplate;

	public String getSql() {
		Configuration config=  sqlSessionTemplate.getConfiguration();
		MappedStatement mappedStatement =config.getMappedStatement("com.linyx.simpleboot.mapper.UserMapper.queryUserList");
				BoundSql boundSql=		mappedStatement.getBoundSql(null);
				return		boundSql.getSql();
	}

}
